<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<title><%@include
		file="/WEB-INF/jsp/admin/public/projectName.jsp"%></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<%@include file="/WEB-INF/jsp/admin/public/cssHeader.jsp"%>
</head>

<body class="white-bg">
	<div id="myTabContent" class="tab-content">
		<!--板块的分页-->
		<div class="tab-pane fade active in wrapper wrapper-content" id="A">

			<form id="defaultForm" name="defaultForm"
				action="${pageContext.request.contextPath}/admin/postChangePassword.html"
				method="post" enctype="multipart/form-data" class="form-horizontal"
				role="form">
				<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">旧密码</label>
					<div class="col-sm-6">
						<input name="oldPassword" type="password" id="inputEmail3" class="form-control"
							required="required" />
					</div>
				</div>

				<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">新密码</label>
					<div class="col-sm-6">
						<input name="newPassword" type="password" id="inputEmail3" class="form-control"
							required="required" />
					</div>
				</div>

				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-primary btn-lg col-sm-6">提交</button>
					</div>
				</div>
			</form>
		</div>
		<!--End 全部-->
		<%@include file="/WEB-INF/jsp/admin/public/jsBottom.jsp"%></title>
	</div>
</body>
</html>

<script>
	$(function() {
		//上传图片
		new AjaxUpload(
				'#uploadImage',
				{
					action : '${pageContext.request.contextPath}/ajax/uploadUserHeadImage.html',
					name : 'headImage',
					responseType : 'json',
					onSubmit : function(file, ext) {
						if (ext && /^(jpg|png|bmp)$/.test(ext.toLowerCase())) {
							this.setData({
								'headImage' : file
							});
						} else {
							alert("请上传格式为 jpg|png|bmp 的图片！");
							return false;
						}
					},
					onComplete : function(file, response) {
						if (response.error) {
							alert(response.error);
							return;
						}
						// 				$("#userimg").attr("src",response.headImage);
						$("#preview").attr("src", response.headImage);
						$(":input[name='image']").val(response.headImage);
						// 				$("#imgHidden").val(response.headImage);
					}
				});
	})

	$("#fileImage").fileinput({
		'allowedFileExtensions' : [ 'jpg', 'png', 'gif' ],
		showUpload : false, //是否显示上传按钮
	});

	jQuery.extend(jQuery.validator.messages, {
		required : "请填写本字段",
		remote : "验证失败",
		email : "请输入正确的电子邮件",
		url : "请输入正确的网址",
		date : "请输入正确的日期",
		dateISO : "请输入正确的日期 (ISO).",
		number : "请输入正确的数字",
		digits : "请输入正确的整数",
		creditcard : "请输入正确的信用卡号",
		equalTo : "请再次输入相同的值",
		accept : "请输入指定的后缀名的字符串",
		maxlength : jQuery.validator.format("允许的最大长度为 {0} 个字符"),
		minlength : jQuery.validator.format("允许的最小长度为 {0} 个字符"),
		rangelength : jQuery.validator.format("允许的长度为{0}和{1}之间"),
		range : jQuery.validator.format("请输入介于 {0} 和 {1} 之间的值"),
		max : jQuery.validator.format("请输入一个最大为 {0} 的值"),
		min : jQuery.validator.format("请输入一个最小为 {0} 的值")
	});
</script>

